Optimal. Leaf size=69 \[ \frac {x^2}{2 a}-\frac {(a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{2 a^{3/2} \sqrt {b}}-\frac {\log \left (a-b+2 a x^2+a x^4\right )}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {1128, 717, 648,
632, 212, 642} \begin {gather*} -\frac {(a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \left (x^2+1\right )}{\sqrt {b}}\right )}{2 a^{3/2} \sqrt {b}}-\frac {\log \left (a x^4+2 a x^2+a-b\right )}{2 a}+\frac {x^2}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 632
Rule 642
Rule 648
Rule 717
Rule 1128
Rubi steps
\begin {align*} \int \frac {x^5}{a-b+2 a x^2+a x^4} \, dx &=\frac {1}{2} \text {Subst}\left (\int \frac {x^2}{a-b+2 a x+a x^2} \, dx,x,x^2\right )\\ &=\frac {x^2}{2 a}+\frac {\text {Subst}\left (\int \frac {-a+b-2 a x}{a-b+2 a x+a x^2} \, dx,x,x^2\right )}{2 a}\\ &=\frac {x^2}{2 a}-\frac {\text {Subst}\left (\int \frac {2 a+2 a x}{a-b+2 a x+a x^2} \, dx,x,x^2\right )}{2 a}+\frac {(a+b) \text {Subst}\left (\int \frac {1}{a-b+2 a x+a x^2} \, dx,x,x^2\right )}{2 a}\\ &=\frac {x^2}{2 a}-\frac {\log \left (a-b+2 a x^2+a x^4\right )}{2 a}-\frac {(a+b) \text {Subst}\left (\int \frac {1}{4 a b-x^2} \, dx,x,2 a \left (1+x^2\right )\right )}{a}\\ &=\frac {x^2}{2 a}-\frac {(a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{2 a^{3/2} \sqrt {b}}-\frac {\log \left (a-b+2 a x^2+a x^4\right )}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 62, normalized size = 0.90 \begin {gather*} -\frac {(a+b) \tanh ^{-1}\left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{2 a^{3/2} \sqrt {b}}+\frac {x^2-\log \left (-b+a \left (1+x^2\right )^2\right )}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.03, size = 63, normalized size = 0.91
method | result | size |
default | \(\frac {x^{2}}{2 a}+\frac {-\ln \left (a \,x^{4}+2 a \,x^{2}+a -b \right )-\frac {\left (a +b \right ) \arctanh \left (\frac {2 a \,x^{2}+2 a}{2 \sqrt {a b}}\right )}{\sqrt {a b}}}{2 a}\) | \(63\) |
risch | \(\frac {x^{2}}{2 a}-\frac {\ln \left (\left (a^{2} b +a \,b^{2}+\sqrt {a b \left (a +b \right )^{2}}\, a \right ) x^{2}+\sqrt {a b \left (a +b \right )^{2}}\, a -\sqrt {a b \left (a +b \right )^{2}}\, b \right )}{2 a}+\frac {\ln \left (\left (a^{2} b +a \,b^{2}+\sqrt {a b \left (a +b \right )^{2}}\, a \right ) x^{2}+\sqrt {a b \left (a +b \right )^{2}}\, a -\sqrt {a b \left (a +b \right )^{2}}\, b \right ) \sqrt {a b \left (a +b \right )^{2}}}{4 a^{2} b}-\frac {\ln \left (\left (a^{2} b +a \,b^{2}-\sqrt {a b \left (a +b \right )^{2}}\, a \right ) x^{2}-\sqrt {a b \left (a +b \right )^{2}}\, a +\sqrt {a b \left (a +b \right )^{2}}\, b \right )}{2 a}-\frac {\ln \left (\left (a^{2} b +a \,b^{2}-\sqrt {a b \left (a +b \right )^{2}}\, a \right ) x^{2}-\sqrt {a b \left (a +b \right )^{2}}\, a +\sqrt {a b \left (a +b \right )^{2}}\, b \right ) \sqrt {a b \left (a +b \right )^{2}}}{4 a^{2} b}\) | \(274\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 74, normalized size = 1.07 \begin {gather*} \frac {x^{2}}{2 \, a} + \frac {{\left (a + b\right )} \log \left (\frac {a x^{2} + a - \sqrt {a b}}{a x^{2} + a + \sqrt {a b}}\right )}{4 \, \sqrt {a b} a} - \frac {\log \left (a x^{4} + 2 \, a x^{2} + a - b\right )}{2 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 156, normalized size = 2.26 \begin {gather*} \left [\frac {2 \, a b x^{2} - 2 \, a b \log \left (a x^{4} + 2 \, a x^{2} + a - b\right ) + \sqrt {a b} {\left (a + b\right )} \log \left (\frac {a x^{4} + 2 \, a x^{2} - 2 \, \sqrt {a b} {\left (x^{2} + 1\right )} + a + b}{a x^{4} + 2 \, a x^{2} + a - b}\right )}{4 \, a^{2} b}, \frac {a b x^{2} - a b \log \left (a x^{4} + 2 \, a x^{2} + a - b\right ) + \sqrt {-a b} {\left (a + b\right )} \arctan \left (\frac {\sqrt {-a b}}{a x^{2} + a}\right )}{2 \, a^{2} b}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 138 vs.
\(2 (60) = 120\).
time = 0.64, size = 138, normalized size = 2.00 \begin {gather*} \left (- \frac {1}{2 a} - \frac {\sqrt {a^{3} b} \left (a + b\right )}{4 a^{3} b}\right ) \log {\left (x^{2} + \frac {- 4 a b \left (- \frac {1}{2 a} - \frac {\sqrt {a^{3} b} \left (a + b\right )}{4 a^{3} b}\right ) + a - b}{a + b} \right )} + \left (- \frac {1}{2 a} + \frac {\sqrt {a^{3} b} \left (a + b\right )}{4 a^{3} b}\right ) \log {\left (x^{2} + \frac {- 4 a b \left (- \frac {1}{2 a} + \frac {\sqrt {a^{3} b} \left (a + b\right )}{4 a^{3} b}\right ) + a - b}{a + b} \right )} + \frac {x^{2}}{2 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.30, size = 60, normalized size = 0.87 \begin {gather*} \frac {x^{2}}{2 \, a} + \frac {{\left (a + b\right )} \arctan \left (\frac {a x^{2} + a}{\sqrt {-a b}}\right )}{2 \, \sqrt {-a b} a} - \frac {\log \left (a x^{4} + 2 \, a x^{2} + a - b\right )}{2 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.39, size = 166, normalized size = 2.41 \begin {gather*} \frac {x^2}{2\,a}-\ln \left (a\,\sqrt {a^3\,b}-b\,\sqrt {a^3\,b}-a^2\,b\,x^2+a\,x^2\,\sqrt {a^3\,b}\right )\,\left (\frac {\frac {a^2}{2}+\frac {\sqrt {a^3\,b}}{4}}{a^3}+\frac {\sqrt {a^3\,b}}{4\,a^2\,b}\right )-\ln \left (a\,\sqrt {a^3\,b}-b\,\sqrt {a^3\,b}+a^2\,b\,x^2+a\,x^2\,\sqrt {a^3\,b}\right )\,\left (\frac {\frac {a^2}{2}-\frac {\sqrt {a^3\,b}}{4}}{a^3}-\frac {\sqrt {a^3\,b}}{4\,a^2\,b}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________